<?php
include_once ('../session.php');
include_once ('../autoload.php');
$user = $_SESSION['id'];

$option = $_POST['option'];
$listado = array();

if(strcmp($option, "account")==0){
	$client = new client();
	$listado['client'] = $client->jsonList($user);
	
	$account = new account();
	$listado['account'] = $account->jsonList($user, "");
}
if(strcmp($option, "transfers")==0){
	$account = new account();
	$ttype	 = new transaction_type();
	$listado['account'] = $account->jsonList($user, "");
	$listado['destiny'] = $account->jsonList($user, $listado['account'][0]['CURRENCY_ID']);
	$listado['types']	= $ttype->jsonList();
	
}
if(strcmp($option, "history")==0){
	$account = new account();
	$listado['account'] = $account->jsonList($user, "");

	$history = new history();
	$listado['history'] = $history->jsonList($listado['account'][0]['ACCOUNT_NUM']);
	
}

echo json_encode($listado);

?>